import pymysql

def test_del():
    # 1、建立连接
    con = pymysql.connect(user='qsai', password='qs123', host='localhost', db='ai_2025', charset='utf8')
    print(con)
    try:
        cursor = con.cursor()
        sql = 'delete from music_163 where id=10'
        sql = 'truncate table music_163'
        cursor.execute(sql)
        con.commit()
    finally:
        cursor.close()
        con.close()

test_del()


